<template>
    <div class="box">
        <header class="header">
            <van-nav-bar title="标题" left-arrow @click-left="$router.back()">
                <template #right>
                    <van-icon name="ellipsis" size="20" />
                </template>
            </van-nav-bar>
        </header>
        <div class="content">
            <!-- {{ detailInfo }} -->
            <div><img style="width:100%;" :src="detailInfo.image" alt=""></div>
            <div>{{ detailInfo.title }}</div>
            <div style="color:red">￥{{ detailInfo.price }}元</div>
        </div>
    </div>
</template>
<script setup>
import { onMounted, ref } from 'vue'
import request from '@/utils/request.js'
import { useRoute } from 'vue-router'
const route = useRoute()
const detailInfo = ref({})
onMounted(() => {
    request.get('/detail', {
        params: {
            id: route.params.id
        }
    }).then(res => {
        if (res.data.code == 200) {
            detailInfo.value = res.data.data
        }
    })

})
</script>